package com.zycfc.zsf.boot.office.excel.constant;

public class ExcelConstant
{
    public static final String excelTemplatePath = "D:\\experiment\\";
    public static final String excelUploadPath = "D:\\experiment\\upload\\";
    public static final int firstDataRow = 1;
    public static final int skipRow = 1;
    
    public enum ExcelTypeEnum
    {
        EXCEL2007("Excel2007", "xlsx"), 
        EXCEL2003("Excel2003", "xls");
        
        private String val;
        private String key;
        
        private ExcelTypeEnum(final String val, final String key) {
            this.val = val;
            this.key = key;
        }
        
        public static String getNm(final String key) {
            for (final ExcelTypeEnum c : values()) {
                if (c.key.equals(key)) {
                    return c.val;
                }
            }
            return null;
        }
        
        public String getValue() {
            return this.key;
        }
        
        public String getDisplayName() {
            return this.val;
        }
    }
    
    public enum ExcelExportErrorEnum
    {
        ERROR1000("\u5f53\u524d\u8def\u5f84excel\u6a21\u677f\u6587\u4ef6\u4e0d\u5b58\u5728", "1000"), 
        ERROR1001("\u83b7\u53d6excel\u6a21\u677f\u6587\u4ef6\u5f02\u5e38", "1001"), 
        ERROR1002("excel\u6a21\u677f\u6587\u4ef6\u540d\u79f0\u4e3a\u7a7a", "1002"), 
        ERROR1003("excel\u6587\u4ef6\u7c7b\u578b\u9519\u8bef", "1003"), 
        ERROR1004("\u5bfc\u51faexcel\u6587\u4ef6\u540d\u79f0\u4e3a\u7a7a", "1004"), 
        ERROR1005("\u4e0a\u4f20excel\u6587\u4ef6\u8def\u5f84\u4e3a\u7a7a", "1005"), 
        ERROR1006("\u5199\u5165\u6570\u636e\u8d77\u59cb\u884c\u9519\u8bef", "1006"), 
        ERROR1007("excel\u6a21\u677f\u6587\u4ef6\u8def\u5f84\u4e3a\u7a7a", "1007"), 
        ERROR1008("\u8bfb\u53d6\u6587\u4ef6\u6d41\u5931\u8d25", "1008"), 
        ERROR1009("\u5199\u5165\u6587\u4ef6\u6d41\u9519\u8bef", "1009"), 
        ERROR1010("\u5173\u95ed\u6587\u4ef6\u6d41\u9519\u8bef", "1010"), 
        ERROR1099("\u5bfc\u51faexcel\u6570\u636e\u5f02\u5e38", "1099");
        
        private String val;
        private String key;
        
        private ExcelExportErrorEnum(final String val, final String key) {
            this.val = val;
            this.key = key;
        }
        
        public static String getNm(final String key) {
            for (final ExcelExportErrorEnum c : values()) {
                if (c.key.equals(key)) {
                    return c.val;
                }
            }
            return null;
        }
        
        public String getValue() {
            return this.key;
        }
        
        public String getDisplayName() {
            return this.val;
        }
    }
    
    public enum ExcelImportErrorEnum
    {
        ERROR2000("\u83b7\u53d6excel\u6587\u4ef6\u5931\u8d25", "2000"), 
        ERROR2001("\u5bfc\u5165\u5217\u540d\u4e3a\u7a7a", "2001"), 
        ERROR2002("\u5bfc\u5165\u7684excel\u6587\u4ef6\u7c7b\u578b\u9519\u8bef", "2002"), 
        ERROR2003("\u5bfc\u5165\u6570\u636e\u5217\u7684\u8bfb\u53d6\u7c7b\u578b\u4e3a\u7a7a", "2003"), 
        ERROR2004("\u5bfc\u5165\u6570\u636e\u8d77\u59cb\u884c\u9519\u8bef", "2004"), 
        ERROR2005("\u5bfc\u5165\u6570\u636e\u4e0e\u5217\u7684\u8bfb\u53d6\u7c7b\u578b\u5339\u914d\u9519\u8bef", "2005"), 
        ERROR2006("\u5bfc\u5165\u6570\u636e\u9a8c\u8bc1\u65b9\u5f0f\u9519\u8bef", "2006"), 
        ERROR2007("\u5bfc\u5165\u6570\u636e\u9a8c\u8bc1\u5f02\u5e38", "2007"), 
        ERROR2099("\u5bfc\u5165excel\u6570\u636e\u5f02\u5e38", "2099");
        
        private String val;
        private String key;
        
        private ExcelImportErrorEnum(final String val, final String key) {
            this.val = val;
            this.key = key;
        }
        
        public static String getNm(final String key) {
            for (final ExcelImportErrorEnum c : values()) {
                if (c.key.equals(key)) {
                    return c.val;
                }
            }
            return null;
        }
        
        public String getValue() {
            return this.key;
        }
        
        public String getDisplayName() {
            return this.val;
        }
    }
    
    public enum ExcelColumnTypeEnum
    {
        Type_int("int", "01"), 
        Type_Integer("Integer", "02"), 
        Type_long("long", "03"), 
        Type_Long("Long", "04"), 
        Type_BigDecimal("BigDecimal", "05"), 
        Type_Date("Date", "06"), 
        Type_boolean("boolean", "07"), 
        Type_Boolean("Boolean", "08"), 
        Type_String("String", "09");
        
        private String val;
        private String key;
        
        private ExcelColumnTypeEnum(final String val, final String key) {
            this.val = val;
            this.key = key;
        }
        
        public static String getNm(final String key) {
            for (final ExcelColumnTypeEnum c : values()) {
                if (c.key.equals(key)) {
                    return c.val;
                }
            }
            return null;
        }
        
        public String getValue() {
            return this.key;
        }
        
        public String getDisplayName() {
            return this.val;
        }
    }
    
    public enum ExcelDataValidateTypeEnum
    {
        ONE("\u4e00\u6761\u6570\u636e\u9519\u8bef\u4fe1\u606f", "01"), 
        ALL("\u6240\u6709\u6570\u636e\u9519\u8bef\u4fe1\u606f", "02");
        
        private String val;
        private String key;
        
        private ExcelDataValidateTypeEnum(final String val, final String key) {
            this.val = val;
            this.key = key;
        }
        
        public static String getNm(final String key) {
            for (final ExcelDataValidateTypeEnum c : values()) {
                if (c.key.equals(key)) {
                    return c.val;
                }
            }
            return null;
        }
        
        public String getValue() {
            return this.key;
        }
        
        public String getDisplayName() {
            return this.val;
        }
    }
}
